🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / androidApp / src / testFdroid / kotlin / org / meshtastic / app / FlavorApplicationConfigurationTest.kt
Displaying Raw • Download
androidApp/src/testFdroid/kotlin/org/meshtastic/app/FlavorApplicationConfigurationTest.kt fix/takserver-kermit-and-remarks (f0002ca6) Text, 2.45 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app
Tff7b72import T7ee787androidx.test.core.app.ApplicationProvider
Tff7b72import T7ee787org.junit.runner.RunWith
Tff7b72import T7ee787org.osmdroid.config.Configuration
Tff7b72import T7ee787org.osmdroid.views.MapView
Tff7b72import T7ee787org.robolectric.RobolectricTestRunner
Tff7b72import T7ee787org.robolectric.annotation.Config
Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertEquals
Tff7b72class T56d364FlavorApplicationConfigurationTest Tb4b4b4{
Tf0883e@Test
Tff7b72fun Td2a8ff`configureFlavorApplication helper sets osmdroid user agent`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3configuration Tff7b72= Te6edf3ConfigurationTb4b4b4.Te6edf3getInstanceTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3original Tff7b72= Te6edf3configurationTb4b4b4.Te6edf3userAgentValue
Tff7b72try Tb4b4b4{
Te6edf3configureFlavorApplicationTb4b4b4(Ta5d6ff"Ta5d6fftest.user.agentTa5d6ff"Tb4b4b4)
Te6edf3assertEqualsTb4b4b4(Ta5d6ff"Ta5d6fftest.user.agentTa5d6ff"Tb4b4b4, Te6edf3configurationTb4b4b4.Te6edf3userAgentValueTb4b4b4)
Tb4b4b4} Tff7b72finally Tb4b4b4{
Te6edf3configurationTb4b4b4.Te6edf3userAgentValue Tff7b72= Te6edf3original
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tf0883e@RunWithTb4b4b4(Te6edf3RobolectricTestRunnerTff7b72::Te6edf3classTb4b4b4)
Tf0883e@ConfigTb4b4b4(Te6edf3application Tff7b72= Te6edf3MeshUtilApplicationTff7b72::Te6edf3classTb4b4b4, Te6edf3sdk Tff7b72= Tff7b72[T79c0ff3T79c0ff4Tff7b72]Tb4b4b4)
Tff7b72class T56d364FlavorApplicationStartupTest Tb4b4b4{
Tf0883e@Test
Tff7b72fun Td2a8ff`production startup configures osmdroid before first map creation`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3configuration Tff7b72= Te6edf3ConfigurationTb4b4b4.Te6edf3getInstanceTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3original Tff7b72= Te6edf3configurationTb4b4b4.Te6edf3userAgentValue
Tff7b72try Tb4b4b4{
Tff7b72val Te6edf3application Tff7b72= Te6edf3ApplicationProviderTb4b4b4.Te6edf3getApplicationContextTff7b72<Te6edf3MeshUtilApplicationTff7b72>Tb4b4b4(Tb4b4b4)
Te6edf3assertEqualsTb4b4b4(Te6edf3applicationTb4b4b4.Te6edf3packageNameTb4b4b4, Te6edf3BuildConfigTb4b4b4.Te6edf3APPLICATION_IDTb4b4b4)
Te6edf3assertEqualsTb4b4b4(Te6edf3BuildConfigTb4b4b4.Te6edf3APPLICATION_IDTb4b4b4, Te6edf3configurationTb4b4b4.Te6edf3userAgentValueTb4b4b4)
Te6edf3MapViewTb4b4b4(Te6edf3applicationTb4b4b4)Tb4b4b4.Te6edf3let Tb4b4b4{ Te6edf3mapView Tff7b72-Tff7b72>
Tff7b72try Tb4b4b4{
Te6edf3assertEqualsTb4b4b4(Te6edf3BuildConfigTb4b4b4.Te6edf3APPLICATION_IDTb4b4b4, Te6edf3configurationTb4b4b4.Te6edf3userAgentValueTb4b4b4)
Tb4b4b4} Tff7b72finally Tb4b4b4{
Te6edf3mapViewTb4b4b4.Te6edf3onDetachTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4} Tff7b72finally Tb4b4b4{
Te6edf3configurationTb4b4b4.Te6edf3userAgentValue Tff7b72= Te6edf3original
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s